<?php

require_once( 'flexical/admin/controller.php' );
require_once( 'flexical/admin/error-request.php' );
require_once( 'flexical/admin/error-response.php' );

class Flexical_Admin_Error_Controller extends Flexical_Admin_Controller
{
	public function respond( $request )
	{
		$response = null;

		switch ( get_class( $request ) )
		{
			case 'Flexical_Admin_Unknown_Request_Type_Request':
				$response = new Flexical_Admin_Unknown_Request_Type_Response( $request->request_type );
				break;

			default:
				throw new Exception( "Unknown request: " . get_class( $request ) );
		}

		return $response;
	}
}

?>
